import request from "@/utils/request";
const BASIC_BASE_URL = "/parameter";
const INDUSTRY_BASE_URL = "/industry";

class BasicAPI {
  /**
   * 删除行业
   *
   */
  static getIndustryDel(data: any) {
    return request<any>({
      url: `${INDUSTRY_BASE_URL}/del`,
      method: "POST",
      data,
    });
  }
  /**
   * 行业详情
   *
   */
  static getIndustryInfo(params: any) {
    return request<any>({
      url: `${INDUSTRY_BASE_URL}/detail`,
      method: "get",
      params,
    });
  }

  /**
   * 修改行业
   *
   */
  static getIndustryUpdate(data: any) {
    return request<any>({
      url: `${INDUSTRY_BASE_URL}/edit`,
      method: "POST",
      data,
    });
  }

  /**
   * 新增行业
   *
   */
  static getIndustryAdd(data: any) {
    return request<any>({
      url: `${INDUSTRY_BASE_URL}/add`,
      method: "POST",
      data,
    });
  }

  /**
   * 获取行业
   *
   */
  static getIndustryList(data: any) {
    return request<any>({
      url: `${INDUSTRY_BASE_URL}/list`,
      method: "POST",
      data,
    });
  }

  /**
   * 获取基本参数
   *
   */
  static getPageInfo() {
    return request<any>({
      url: `${BASIC_BASE_URL}/options`,
      method: "get",
    });
  }

  /**
   * 保存
   *
   * @param data 保存
   */
  static getInfoSet(data: any) {
    return request<any>({
      url: `${BASIC_BASE_URL}/set`,
      method: "post",
      data,
    });
  }
}

export default BasicAPI;

/** 菜单视图对象 */
export interface industryVO {
  /** 子菜单 */
  children?: industryVO[];
  /** 菜单名称 */
  name?: string;
}
